<div class="page-header">
	<h1>分类管理</h1>
</div>
<form id="form_search" name="form_search" method="post" action="">
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-left" id="main-sub-menu">
				<?php include $mainSubMenu;?>
			</div>
			<div class="pull-right">
				<a onclick="save();"  class="btn btn-sm btn-primary">保存</a>
			</div>
		</div>
	</div>
</form>
<!-- 功能操作区域结束 -->
<!-- 列表显示区域  -->
<div class="row">
	<div class="col-sm-4 sub_left_menu">
		<div class="well">
			<ul class="tree_menu"></ul>
		</div>
	</div>
	<div class="col-sm-8 sub_content">
		<form action="<?php echo C('backend');?>index.php?com=items&c=category&m=add" id="form_data" name="form_data" method="post" class="well form-horizontal clearfix">
			<input type="hidden" name="ajax" id="ajax" value="1">
			<input type="hidden" name="opmode" id="opmode" value="">
			<input type="hidden" name="dosubmit" value="1" />
			<input type="hidden" name="id" value="<?php echo $id;?>" />
			<input type="hidden" name="__token__" value="<?php echo $token;?>" />
			<?php if(!$id || $category['parent_id'] > 0):?>
			<div class="form-group col-xs-12">
				<label class="col-sm-4 control-label" for="parent_id">上级分类*：</label>
				<div class="col-sm-8">
					<select name="parent_id" id="parent_id" class="form-control">
						<option value="0">一级分类</option>
						<?php foreach($lists as $list):?>
						<option value="<?php echo $list['id'];?>"><?php echo $list['name'];?></option>
						<?php endforeach;?>
					</select>
				</div>
			</div>
			<?php endif;?>

			<div class="form-group col-xs-12">
				<label class="col-sm-4 control-label" for="name">名称*：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称" value="<?php echo $category['name'];?>" />
				</div>
			</div>

			<div class="form-group col-xs-12">
				<label class="col-sm-4 control-label" for="sort">排序：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" id="sort" name="sort" value="<?php echo $category['sort'];?>">
				</div>
			</div>

			<div class="form-group col-xs-12">
				<label class="col-sm-4 control-label" for="status">状态*：</label>
				<div class="col-sm-8">
					<select name="status" id="status" class="form-control">
						<option value="1" <?php echo $category['status'] ==1 ? 'selected="selected"' : '';?>>启用</option>
						<option value="0" <?php echo $category['status'] ==0 ? 'selected="selected"' : '';?>>禁用</option>
					</select>
				</div>
			</div>

			<div class="form-group col-xs-12">
				<label class="col-sm-4 control-label" for="description" >简介：</label>
				<div class="col-sm-8" >
					<textarea class="form-control" name="description" id="description" rows="5" class="col-xs-12" ><?php echo $category['description'];?></textarea>
				</div>
			</div>
		</form>
	</div>
</div>